<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8"/>
    <title>公告详情 | 及第竞赛网</title>
    <link rel="stylesheet" href="../css/first.css"/>
    <link rel="stylesheet" href="../css/font-awesome.min.css">

</head>

<body>
<div class="container" >
    <header class="header">
        <div class="brand">
            <div class="brand-icon">
                <a href="home.html">
                    <span>及第</span>竞赛网
                </a>
            </div>
        </div>
        <nav class="nav">
            <div class="nav-menu">
                <ul>
                    <li class="nav-btn">
                        <a href="home.html">首页</a>
                    </li>
                    <li class="nav-btn">
                        <a href="noticeOfContest.html">比赛公告</a>
                    </li>
                    <li class="nav-btn">
                        <a href="informationOfContest.html">比赛信息</a>
                    </li>
                    <li class="nav-btn">
                        <a href="newsOfContest.html">比赛资讯</a>
                    </li>
                    <!--<li class="nav-btn">-->
                        <!--<a href="">报名</a>-->
                    <!--</li>-->
                </ul>
            </div>
        </nav>
    </header>
    <section class="content" id="notice">
        <section class="section">
            <div class="section-header" style=" height:auto; text-align: center;">
                <div class="section-title">
                    <h2>{{mydata.title}}</h2>
                    <span>{{mydata.addtime}}</span>
                    <span>{{mydata.modifiName}}</span>
                </div>
            </div>
            <div class="section-body" style="line-height: 2.4rem; margin-top: 50px;">
                <article v-html="mydata.content" style="text-align: justify">
                </article>
            </div>
        </section>
    </section>
</div>
<footer class="footer">
    <p>Copyright © 2018-2019 JIDI All rights reserved.</p>
</footer>




<script type="text/javascript" src="../js/vue.min.js"></script>
<script type="text/javascript" src="../js/axios.min.js"></script>
<script type="text/javascript" src="../js/cookieUtil.js"></script>

<script type="text/javascript">
    var url1 = "http://donting.free.idcfengye.com";
    var cp = new Vue({

        el: '#notice',
        data: {
            mydata: {}, //信息
            noId: '', //公告id

        },
        methods: {

            //获取一条公告
            getOneNotice: function (noId) {
                console.log(noId + "--noId");
                axios.defaults.withCredentials = true;
                axios.get(url1 + '/notice/findOne', {
                    params: {
                        noId: noId,
                    }
                }).then(function (response) {
                    var rs = response.data;

                    if (rs.code == 200) {
                        cp.mydata = rs.data;
                        console.log("获取比赛公告成功");
                    } else {
                        console.log("获取比赛公告失败");
                    }

                }).catch(function (error) {
                    console.log("获取公告连接超时！");
                });
            },
        },
        mounted() {

            this.noId = getCookie("noId");
            this.getOneNotice(this.noId);
        }

    })
</script>

</body>

</html>